package com.taotao.slf4j;

import org.junit.Test;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class Slf4jTest {
    @Test
    public void test01() {
        Logger logger = LoggerFactory.getLogger(Slf4jTest.class);
        logger.trace("trace信息");
        logger.debug("debug信息");
        logger.info("info信息");
        logger.warn("warn信息");
        logger.error("error信息");

        try {
            String name = "zs";
            int age = 23;
            logger.info("学生信息-姓名：{}，年龄：{}", name, age);
            int i = 1 / 0;
        } catch (Exception e) {
            logger.error(e.getMessage(), e);
            logger.info(e.getMessage(), e);
        }
    }
}
